//
//  LogInViewController.m
//  Everest
//
//  Created by 刘宇文 on 14-12-18.
//  Copyright (c) 2014年 ThreeL. All rights reserved.
//

#import "LogInViewController.h"
#import "WeiboSDK.h"

#define APPKEY @"3856338914"
#define REDIRECTURI @"http://www.sharesdk.cn"

@interface LogInViewController ()

@end

@implementation LogInViewController

- (void)dealloc
{
        [super dealloc];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    self.title = @"登录";
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
    button.frame = CGRectMake((self.view.bounds.size.width - self.view.bounds.size.width / 2.5) / 2 , (self.view.bounds.size.height - self.view.bounds.size.height / 22.3) / 2, self.view.bounds.size.width / 2.5, self.view.bounds.size.height / 22.3);
    button.backgroundColor = [UIColor redColor];
    [button setTitle:@"新浪微博登陆" forState:UIControlStateNormal];
    [button addTarget:self action:@selector(sinaButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button];
}

- (void)sinaButtonClicked:(UIButton *)button
{
        // 新浪微博登录按钮实现方法
//    
//    WBAuthorizeRequest *request = [WBAuthorizeRequest request];
//    request.redirectURI = REDIRECTURI;
//    request.scope = @"all";
//    request.userInfo = @{@"SSO_From": @"MianViewController",
//                         @"Other_Info_1": [NSNumber numberWithInt:123],
//                         @"Other_Info_2": @[@"obj1", @"obj2"],
//                         @"Other_Info_3": @{@"key1": @"obj1", @"key2": @"obj2"}};
//    [WeiboSDK sendRequest:request];

}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
